
function selectProvince(province){
    if(province<=0) {
        return ;
    }
    // 判断是否改变了省份选择
    var curr = jQuery("#accountProvince").attr("codeValue");
    if(province==curr) {
        return ;
    }

    // 重置选择的城市
    jQuery("#accountCity").attr("codeValue",-1);
    jQuery("#accountCity").html("&nbsp;");
    jQuery("#accountCityUl").html(getCitiesLi(province));
}

function chooseProvinceInfo(li,type){
    selectProvince(type);
    var html=li.innerHTML;
    var code = jQuery(li).attr("code");
    jQuery("#accountProvince").html(html);
    jQuery("#accountProvince").attr("codeValue",code);
}

function selectCity(city){

}

function showAccountAddress(province, city){
    if(province<=0 || city<=0) {
        return ;
    }
    var provinceInfo = provinces[province];
    var cityInfo = getCityInfo(province, city);
    if(provinceInfo==null || cityInfo==null) {
        return ;
    }

    jQuery("#accountProvince").attr("codeValue",provinceInfo.code);
    jQuery("#accountProvince").html(provinceInfo.province);

    jQuery("#accountCity").attr("codeValue",cityInfo.code);
    jQuery("#accountCity").html(cityInfo.city);
    jQuery("#accountCityUl").html(getCitiesLi(province));
}

function chooseCityInfo(li){
    var html=li.innerHTML;
    var code = jQuery(li).attr("code");
    jQuery("#accountCity").html(html);
    jQuery("#accountCity").attr("codeValue",code);
}

function getCitiesLi(province){
    var str = eval("cities_"+province);
    if(str==null || str=="") {
        return "";
    }
    var cities = eval(str);
    var html = [];
    for(var i=0;i<cities.length;i++){
        html.push('<li onclick="chooseCityInfo(this);" code="'+cities[i].code+'"><span>'+cities[i].city+'</span></li>');
    }
    return html.join("");
}

function getCityInfo(province,city){
    var str = eval("cities_"+province);
    if(str==null || str=="") {
        return "";
    }
    var cities = eval(str);
    for(var i=0;i<cities.length;i++){
        if(cities[i].code = city) {
            return cities[i];
        }
    }
    return null;
}

// 省份列表，人民币提现页面，绑定企业账户银行卡时使用
var provinces =  '[' + '{"code":1,"province":"北京"},'
    + '{"code":2,"province":"上海"},'
    + '{"code":3,"province":"天津"},'
    + '{"code":4,"province":"重庆"},'
    + '{"code":5,"province":"河北"},'
    + '{"code":6,"province":"山西"},'
    + '{"code":7,"province":"内蒙古"},'
    + '{"code":8,"province":"辽宁"},'
    + '{"code":9,"province":"吉林"},'
    + '{"code":10,"province":"黑龙江"},'
    + '{"code":11,"province":"江苏"},'
    + '{"code":12,"province":"浙江"},'
    + '{"code":13,"province":"安徽"},'
    + '{"code":14,"province":"福建"},'
    + '{"code":15,"province":"江西"},'
    + '{"code":16,"province":"山东"},'
    + '{"code":17,"province":"河南"},'
    + '{"code":18,"province":"湖北"},'
    + '{"code":19,"province":"湖南"},'
    + '{"code":20,"province":"广东"},'
    + '{"code":21,"province":"广西"},'
    + '{"code":22,"province":"海南"},'
    + '{"code":23,"province":"四川"},'
    + '{"code":24,"province":"贵州"},'
    + '{"code":25,"province":"云南"},'
    + '{"code":26,"province":"西藏"},'
    + '{"code":27,"province":"陕西"},'
    + '{"code":28,"province":"甘肃"},'
    + '{"code":29,"province":"宁夏"},'
    + '{"code":30,"province":"青海"},'
    + '{"code":31,"province":"新疆"}' + ']';

// 各省份的城市列表
var cities_1 = '[{"code":10,"city":"北京"}]';
var cities_2 = '[{"code":21,"city":"上海"}]';
var cities_3 = '[{"code":22,"city":"天津"}]';
var cities_4 = '[' + '{"code":21,"city":"重庆"},'
    + '{"code":230,"city":"涪陵市"},'
    + '{"code":231,"city":"万州市"},'
    + '{"code":232,"city":"黔江市"}' + ']';
var cities_5 = '[' + '{"code":311,"city":"石家庄"},'
    + '{"code":313,"city":"张家口"},'
    + '{"code":314,"city":"承德"},'
    + '{"code":335,"city":"秦皇岛"},'
    + '{"code":315,"city":"唐山"},'
    + '{"code":316,"city":"廊坊"},'
    + '{"code":312,"city":"保定"},'
    + '{"code":317,"city":"沧州"},'
    + '{"code":318,"city":"衡水"},'
    + '{"code":319,"city":"邢台"},'
    + '{"code":310,"city":"邯郸"}' + ']';
var cities_6 = '[' + '{"code":351,"city":"太原"},'
    + '{"code":352,"city":"大同"},'
    + '{"code":349,"city":"朔州"},'
    + '{"code":353,"city":"阳泉"},'
    + '{"code":349,"city":"朔州"},'
    + '{"code":355,"city":"长治"},'
    + '{"code":356,"city":"晋城"},'
    + '{"code":350,"city":"忻州"},'
    + '{"code":358,"city":"离石"},'
    + '{"code":354,"city":"晋中"},'
    + '{"code":357,"city":"临汾"},'
    + '{"code":359,"city":"运城"},'
    + '{"code":242,"city":"吕梁市"}' + ']';
var cities_7 = '[' + '{"code":471,"city":"呼和浩特"},'
    + '{"code":472,"city":"包头"},'
    + '{"code":473,"city":"乌海"},'
    + '{"code":476,"city":"赤峰"},'
    + '{"code":470,"city":"海拉尔"},'
    + '{"code":482,"city":"乌兰浩特"},'
    + '{"code":475,"city":"通辽"},'
    + '{"code":479,"city":"锡林浩特"},'
    + '{"code":474,"city":"集宁"},'
    + '{"code":477,"city":"东胜"},'
    + '{"code":478,"city":"临河"},'
    + '{"code":483,"city":"阿拉善左旗"},'
    + '{"code":480,"city":"巴彦淖尔市"},'
    + '{"code":489,"city":"鄂尔多斯市"},'
    + '{"code":481,"city":"呼伦贝尔市"},'
    + '{"code":484,"city":"乌兰察布市"},'
    + '{"code":485,"city":"锡林郭勒盟"},'
    + '{"code":486,"city":"兴安盟"}' + ']';
var cities_8 = '[' + '{"code":24,"city":"沈阳"},'
    + '{"code":421,"city":"朝阳"},'
    + '{"code":418,"city":"阜新"},'
    + '{"code":410,"city":"铁岭"},'
    + '{"code":413,"city":"抚顺"},'
    + '{"code":414,"city":"本溪"},'
    + '{"code":419,"city":"辽阳"},'
    + '{"code":412,"city":"鞍山"},'
    + '{"code":415,"city":"丹东"},'
    + '{"code":411,"city":"大连"},'
    + '{"code":417,"city":"营口"},'
    + '{"code":427,"city":"盘锦"},'
    + '{"code":416,"city":"锦州"},'
    + '{"code":429,"city":"葫芦岛"}' + ']';
var cities_9 = '[' + '{"code":431,"city":"长春"},'
    + '{"code":436,"city":"白城"},'
    + '{"code":438,"city":"松原"},'
    + '{"code":432,"city":"吉林"},'
    + '{"code":434,"city":"四平"},'
    + '{"code":437,"city":"辽源"},'
    + '{"code":435,"city":"通化"},'
    + '{"code":439,"city":"白山"},'
    + '{"code":433,"city":"延吉"},'
    + '{"code":247,"city":"延边州"}' + ']';
var cities_10 = '[' + '{"code":451,"city":"哈尔滨"},'
    + '{"code":452,"city":"齐齐哈尔"},'
    + '{"code":456,"city":"黑河"},'
    + '{"code":459,"city":"大庆"},'
    + '{"code":458,"city":"伊春"},'
    + '{"code":468,"city":"鹤岗"},'
    + '{"code":454,"city":"佳木斯"},'
    + '{"code":469,"city":"双鸭山"},'
    + '{"code":464,"city":"七台河"},'
    + '{"code":467,"city":"鸡西"},'
    + '{"code":453,"city":"牡丹江"},'
    + '{"code":455,"city":"绥化"},'
    + '{"code":457,"city":"加格达奇"},'
    + '{"code":285,"city":"大兴安岭地区"}' + ']';
var cities_11 = '[' + '{"code":25,"city":"南京"},'
    + '{"code":512,"city":"苏州"},'
    + '{"code":516,"city":"徐州"},'
    + '{"code":518,"city":"连云港"},'
    + '{"code":527,"city":"宿迁"},'
    + '{"code":517,"city":"淮安"},'
    + '{"code":515,"city":"盐城"},'
    + '{"code":514,"city":"扬州"},'
    + '{"code":523,"city":"泰州"},'
    + '{"code":513,"city":"南通"},'
    + '{"code":511,"city":"镇江"},'
    + '{"code":519,"city":"常州"},'
    + '{"code":510,"city":"无锡"}' + ']';
var cities_12 = '[' + '{"code":571,"city":"杭州"},'
    + '{"code":572,"city":"湖州"},'
    + '{"code":573,"city":"嘉兴"},'
    + '{"code":580,"city":"舟山"},'
    + '{"code":574,"city":"宁波"},'
    + '{"code":575,"city":"绍兴"},'
    + '{"code":579,"city":"金华"},'
    + '{"code":576,"city":"台州"},'
    + '{"code":577,"city":"温州"},'
    + '{"code":578,"city":"丽水"},'
    + '{"code":570,"city":"衢州"},' + ']';
var cities_13 = '[' + '{"code":551,"city":"合肥"},'
    + '{"code":557,"city":"宿州"},'
    + '{"code":561,"city":"淮北"},'
    + '{"code":558,"city":"阜阳"},'
    + '{"code":552,"city":"蚌埠"},'
    + '{"code":554,"city":"淮南"},'
    + '{"code":550,"city":"滁州"},'
    + '{"code":555,"city":"马鞍山"},'
    + '{"code":553,"city":"芜湖"},'
    + '{"code":562,"city":"铜陵"},'
    + '{"code":556,"city":"安庆"},'
    + '{"code":559,"city":"黄山"},'
    + '{"code":564,"city":"六安"},'
    + '{"code":565,"city":"巢湖"},'
    + '{"code":566,"city":"贵池"},'
    + '{"code":563,"city":"宣城"},'
    + '{"code":5581,"city":"毫州"}' + ']';
var cities_14 = '[' + '{"code":591,"city":"福州"},'
    + '{"code":599,"city":"南平"},'
    + '{"code":598,"city":"三明"},'
    + '{"code":594,"city":"莆田"},'
    + '{"code":595,"city":"泉州"},'
    + '{"code":592,"city":"厦门"},'
    + '{"code":596,"city":"漳州"},'
    + '{"code":597,"city":"龙岩"},'
    + '{"code":593,"city":"宁德"},'
    + '{"code":5930,"city":"福安"},'
    + '{"code":5990,"city":"邵武"},'
    + '{"code":5950,"city":"石狮"},'
    + '{"code":5980,"city":"永安"},'
    + '{"code":5991,"city":"武夷山"},'
    + '{"code":5995,"city":"福清"}' + ']';
var cities_15 = '[' + '{"code":791,"city":"南昌"},'
    + '{"code":792,"city":"九江"},'
    + '{"code":798,"city":"景德镇"},'
    + '{"code":701,"city":"鹰潭"},'
    + '{"code":790,"city":"新余"},'
    + '{"code":799,"city":"萍乡"},'
    + '{"code":797,"city":"赣州"},'
    + '{"code":793,"city":"上饶"},'
    + '{"code":794,"city":"临川"},'
    + '{"code":795,"city":"宜春"},'
    + '{"code":796,"city":"吉安"},'
    + '{"code":7940,"city":"抚州"}' + ']';
var cities_16 = '[' + '{"code":531,"city":"济南"},'
    + '{"code":635,"city":"聊城"},'
    + '{"code":534,"city":"德州"},'
    + '{"code":546,"city":"东营"},'
    + '{"code":533,"city":"淄博"},'
    + '{"code":536,"city":"潍坊"},'
    + '{"code":535,"city":"烟台"},'
    + '{"code":631,"city":"威海"},'
    + '{"code":532,"city":"青岛"},'
    + '{"code":633,"city":"日照"},'
    + '{"code":539,"city":"临沂"},'
    + '{"code":632,"city":"枣庄"},'
    + '{"code":537,"city":"济宁"},'
    + '{"code":538,"city":"泰安"},'
    + '{"code":634,"city":"莱芜"},'
    + '{"code":543,"city":"滨州"},'
    + '{"code":530,"city":"菏泽"}' + ']';
var cities_17 = '[' + '{"code":371,"city":"郑州"},'
    + '{"code":398,"city":"三门峡"},'
    + '{"code":379,"city":"洛阳"},'
    + '{"code":391,"city":"焦作"},'
    + '{"code":373,"city":"新乡"},'
    + '{"code":392,"city":"鹤壁"},'
    + '{"code":372,"city":"安阳"},'
    + '{"code":393,"city":"濮阳"},'
    + '{"code":378,"city":"开封"},'
    + '{"code":370,"city":"商丘"},'
    + '{"code":374,"city":"许昌"},'
    + '{"code":395,"city":"漯河"},'
    + '{"code":375,"city":"平顶山"},'
    + '{"code":377,"city":"南阳"},'
    + '{"code":376,"city":"信阳"},'
    + '{"code":3910,"city":"济源"},'
    + '{"code":394,"city":"周口"},'
    + '{"code":396,"city":"驻马店"}' + ']';
var cities_18 = '[' + '{"code":27,"city":"武汉"},'
    + '{"code":719,"city":"十堰"},'
    + '{"code":710,"city":"襄樊"},'
    + '{"code":724,"city":"荆门"},'
    + '{"code":712,"city":"孝感"},'
    + '{"code":713,"city":"黄冈"},'
    + '{"code":711,"city":"鄂州"},'
    + '{"code":714,"city":"黄石"},'
    + '{"code":715,"city":"咸宁"},'
    + '{"code":716,"city":"荆州"},'
    + '{"code":717,"city":"宜昌"},'
    + '{"code":718,"city":"恩施"},'
    + '{"code":728,"city":"仙桃"},'
    + '{"code":7281,"city":"潜江"},'
    + '{"code":722,"city":"随州市"},'
    + '{"code":7221,"city":"广水"},'
    + '{"code":7282,"city":"天门"}' + ']';
var cities_19 = '[' + '{"code":731,"city":"长沙"},'
    + '{"code":744,"city":"张家界"},'
    + '{"code":736,"city":"常德"},'
    + '{"code":737,"city":"益阳"},'
    + '{"code":730,"city":"岳阳"},'
    + '{"code":733,"city":"株洲"},'
    + '{"code":732,"city":"湘潭"},'
    + '{"code":734,"city":"衡阳"},'
    + '{"code":735,"city":"郴州"},'
    + '{"code":746,"city":"永州"},'
    + '{"code":739,"city":"邵阳"},'
    + '{"code":745,"city":"怀化"},'
    + '{"code":738,"city":"娄底"},'
    + '{"code":743,"city":"吉首"}' + ']';
var cities_20 = '[' + '{"code":20,"city":"广州"},'
    + '{"code":755,"city":"深圳"},'
    + '{"code":763,"city":"清远"},'
    + '{"code":751,"city":"韶关"},'
    + '{"code":762,"city":"河源"},'
    + '{"code":753,"city":"梅州"},'
    + '{"code":768,"city":"潮州"},'
    + '{"code":754,"city":"汕头"},'
    + '{"code":663,"city":"揭阳"},'
    + '{"code":660,"city":"汕尾"},'
    + '{"code":752,"city":"惠州"},'
    + '{"code":769,"city":"东莞"},'
    + '{"code":756,"city":"珠海"},'
    + '{"code":760,"city":"中山"},'
    + '{"code":750,"city":"江门"},'
    + '{"code":757,"city":"佛山"},'
    + '{"code":668,"city":"茂名"},'
    + '{"code":759,"city":"湛江"},'
    + '{"code":662,"city":"阳江"},'
    + '{"code":766,"city":"云浮"},'
    + '{"code":758,"city":"肇庆"}' + ']';
var cities_21 = '[' + '{"code":771,"city":"南宁"},'
    + '{"code":773,"city":"桂林"},'
    + '{"code":772,"city":"柳州"},'
    + '{"code":774,"city":"贺州"},'
    + '{"code":775,"city":"玉林"},'
    + '{"code":777,"city":"钦州"},'
    + '{"code":779,"city":"北海"},'
    + '{"code":770,"city":"防城港"},'
    + '{"code":776,"city":"百色"},'
    + '{"code":778,"city":"河池"},'
    + '{"code":7750,"city":"贵港"},'
    + '{"code":7740,"city":"梧州"},'
    + '{"code":7711,"city":"崇左市"},'
    + '{"code":284,"city":"来宾市"}' + ']';
var cities_22 = '[' + '{"code":898,"city":"海口"},'
    + '{"code":899,"city":"三亚"},'
    + '{"code":890,"city":"儋州"},'
    + '{"code":8901,"city":"琼海"},'
    + '{"code":8902,"city":"文昌"},'
    + '{"code":8903,"city":"万宁"},'
    + '{"code":8904,"city":"五指山"},'
    + '{"code":8905,"city":"东方"}' + ']';
var cities_23 = '[' + '{"code":28,"city":"成都"},'
    + '{"code":839,"city":"广元"},'
    + '{"code":816,"city":"绵阳"},'
    + '{"code":838,"city":"德阳"},'
    + '{"code":817,"city":"南充"},'
    + '{"code":826,"city":"广安"},'
    + '{"code":825,"city":"遂宁"},'
    + '{"code":832,"city":"内江"},'
    + '{"code":833,"city":"乐山"},'
    + '{"code":813,"city":"自贡"},'
    + '{"code":830,"city":"泸州"},'
    + '{"code":831,"city":"宜宾"},'
    + '{"code":812,"city":"攀枝花"},'
    + '{"code":827,"city":"巴中"},'
    + '{"code":818,"city":"达州"},'
    + '{"code":8320,"city":"资阳"},'
    + '{"code":835,"city":"雅安"},'
    + '{"code":834,"city":"西昌"},'
    + '{"code":837,"city":"阿坝州"},'
    + '{"code":828,"city":"眉山市"},'
    + '{"code":281,"city":"凉山州"},'
    + '{"code":282,"city":"甘孜州"}' + ']';
var cities_24 = '[' + '{"code":851,"city":"贵阳"},'
    + '{"code":858,"city":"六盘水"},'
    + '{"code":852,"city":"遵义"},'
    + '{"code":857,"city":"毕节"},'
    + '{"code":856,"city":"铜仁"},'
    + '{"code":853,"city":"安顺"},'
    + '{"code":855,"city":"凯里"},'
    + '{"code":854,"city":"都匀"},'
    + '{"code":859,"city":"兴义"},'
    + '{"code":243,"city":"黔东南州"},'
    + '{"code":244,"city":"黔南州"},'
    + '{"code":245,"city":"黔西南州"}' + ']';
var cities_25 = '[' + '{"code":871,"city":"昆明"},'
    + '{"code":874,"city":"曲靖"},'
    + '{"code":877,"city":"玉溪"},'
    + '{"code":888,"city":"丽江"},'
    + '{"code":870,"city":"昭通"},'
    + '{"code":879,"city":"思茅"},'
    + '{"code":883,"city":"临沧"},'
    + '{"code":875,"city":"保山"},'
    + '{"code":692,"city":"潞西"},'
    + '{"code":886,"city":"泸水"},'
    + '{"code":887,"city":"中甸"},'
    + '{"code":872,"city":"大理"},'
    + '{"code":878,"city":"楚雄"},'
    + '{"code":873,"city":"个旧"},'
    + '{"code":876,"city":"文山"},'
    + '{"code":691,"city":"景洪"},'
    + '{"code":8730,"city":"红河"},'
    + '{"code":286,"city":"德宏州"},'
    + '{"code":287,"city":"迪庆州"},'
    + '{"code":288,"city":"西双版纳州"},'
    + '{"code":289,"city":"怒江州"}' + ']';
var cities_26 = '[' + '{"code":891,"city":"拉萨"},'
    + '{"code":896,"city":"那曲"},'
    + '{"code":895,"city":"昌都"},'
    + '{"code":894,"city":"林芝"},'
    + '{"code":893,"city":"乃东"},'
    + '{"code":892,"city":"日喀则"},'
    + '{"code":897,"city":"噶尔"},'
    + '{"code":8971,"city":"阿里地区"},'
    + '{"code":900,"city":"山南地区"},'
    + '{"code":800,"city":"樟木口岸"}' + ']';
var cities_27 = '[' + '{"code":29,"city":"西安"},'
    + '{"code":911,"city":"延安"},'
    + '{"code":919,"city":"铜川"},'
    + '{"code":913,"city":"渭南"},'
    + '{"code":910,"city":"咸阳"},'
    + '{"code":917,"city":"宝鸡"},'
    + '{"code":916,"city":"汉中"},'
    + '{"code":912,"city":"榆林"},'
    + '{"code":914,"city":"商洛"},'
    + '{"code":915,"city":"安康"}' + ']';
var cities_28 = '[' + '{"code":931,"city":"兰州"},'
    + '{"code":937,"city":"嘉峪关"},'
    + '{"code":943,"city":"白银"},'
    + '{"code":938,"city":"天水"},'
    + '{"code":9370,"city":"酒泉"},'
    + '{"code":936,"city":"张掖"},'
    + '{"code":935,"city":"金昌"},'
    + '{"code":934,"city":"庆阳"},'
    + '{"code":933,"city":"平凉"},'
    + '{"code":932,"city":"定西"},'
    + '{"code":939,"city":"陇南"},'
    + '{"code":930,"city":"临夏"},'
    + '{"code":941,"city":"甘南藏族"},'
    + '{"code":9350,"city":"武威市"}' + ']';
var cities_29 = '[' + '{"code":951,"city":"银川"},'
    + '{"code":952,"city":"石嘴山"},'
    + '{"code":953,"city":"吴忠"},'
    + '{"code":954,"city":"固原"},'
    + '{"code":248,"city":"中卫市"}' + ']';
var cities_30 = '[' + '{"code":971,"city":"西宁"},'
    + '{"code":972,"city":"平安"},'
    + '{"code":970,"city":"海晏"},'
    + '{"code":974,"city":"共和"},'
    + '{"code":973,"city":"同仁"},'
    + '{"code":975,"city":"玛沁"},'
    + '{"code":976,"city":"玉树"},'
    + '{"code":977,"city":"德令哈"},'
    + '{"code":236,"city":"果洛藏族自治州"},'
    + '{"code":237,"city":"海北藏族自治州"},'
    + '{"code":238,"city":"海东地区"},'
    + '{"code":239,"city":"海南藏族自治州"},'
    + '{"code":240,"city":"海西蒙古族藏族自治州"},'
    + '{"code":241,"city":"黄南藏族自治州"}' + ']';
var cities_31 = '[' + '{"code":991,"city":"乌鲁木齐"},'
    + '{"code":990,"city":"克拉玛依"},'
    + '{"code":993,"city":"石河子"},'
    + '{"code":998,"city":"喀什"},'
    + '{"code":997,"city":"阿克苏"},'
    + '{"code":903,"city":"和田"},'
    + '{"code":995,"city":"吐鲁番"},'
    + '{"code":902,"city":"哈密"},'
    + '{"code":908,"city":"阿图什"},'
    + '{"code":909,"city":"博乐"},'
    + '{"code":994,"city":"昌吉"},'
    + '{"code":996,"city":"库尔勒"},'
    + '{"code":999,"city":"伊犁"},'
    + '{"code":992,"city":"奎屯"},'
    + '{"code":901,"city":"塔城"},'
    + '{"code":906,"city":"阿勒泰"},'
    + '{"code":904,"city":"巴音郭楞蒙古自治州"},'
    + '{"code":905,"city":"博尔塔拉蒙古自治州"},'
    + '{"code":907,"city":"克孜勒苏柯尔克孜自治州"},'
    + '{"code":989,"city":"伊犁哈萨克自治州"}' + ']';

